package pl.koziolekweb.testsonline.model;

import java.io.Serializable;
import java.util.Collection;
import java.util.LinkedList;

public class Question implements Serializable {

	private static final long serialVersionUID = 1304332221114478716L;

	private Collection<Answer> answers = new LinkedList<Answer>();

	private String content;

	private Boolean multiplayAnswerAllow;

	private Long testId;

	private Long id;

	public boolean addAnswer(Answer answer) {
		return this.answers.add(answer);
	}

	public boolean removeAnswer(Answer answer) {
		return this.answers.remove(answer);
	}

	public Collection<Answer> getAnswers() {
		return answers;
	}

	public void setAnswers(Collection<Answer> answers) {
		this.answers = answers;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Long getTestId() {
		return testId;
	}

	public void setTestId(Long testId) {
		this.testId = testId;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setMultiplayAnswerAllow(Boolean multiplayAnswerAllow) {
		this.multiplayAnswerAllow = multiplayAnswerAllow;
	}

	public Boolean getMultiplayAnswerAllow() {
		return multiplayAnswerAllow;
	}

	public Question() {
	}

	public Question(Collection<Answer> answers, String content,
			Boolean multiplayAnswerAllow) {
		this.answers = answers;
		this.content = content;
		this.multiplayAnswerAllow = multiplayAnswerAllow;
	}

	public Question(String content) {
		this.content = content;
	}
}
